package com.csoa.community.db;

import com.csoa.community.singletons.GlobalVars;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

public class DataBaseDB {

	public static SQLiteDatabase db;
	private DatabaseHelper dbHelper;
	public Context context;

	public static DataBaseDB _inst = new DataBaseDB();
	public static DataBaseDB getInst() {
		return _inst;
	}
	public void createDB(Context context) {
		this.context = context;
		dbHelper = new DatabaseHelper(context, GlobalVars.DATABASE_NAME, null,
				1);
		getDB();
	}

	public void getDB() {
		if (dbHelper == null) {
			dbHelper = new DatabaseHelper(context, GlobalVars.DATABASE_NAME,
					null, 1);
		}
		db = dbHelper.getWritableDatabase();
	}

}
